package model;

import javax.microedition.lcdui.Graphics;

import screen.PaintPopup;
import screen.RoomListScr;
import utilities.GameResource;

import font.BitmapFont;

public class BoardInfo extends ItemInfo{
	public byte nPlayer,maxPlayer = 4;
	public boolean isPass,isPlaying;
	public int money;
	public String strMoney;
	public boolean m_bIsSelected;	
	
	public void paintInRow(Graphics g, int x, int y, int width, int height, boolean isFocus){
		int color = 0x9be5ff;
		if(m_bIsSelected)
			color = 0xfbd634;
		else if(isPlaying){
			color = 0x8bd418;
		}
		//18
		PaintPopup.paintRoundRect(g, x, y + 2, width, 28, 10, color);
		if(RoomListScr.m_iIconGame == 13){
			BitmapFont.drawBoldFont(g, "Lớp " + m_iId, x + width - 10, y + height/2 - 7, 0x3a001e, Graphics.VCENTER | Graphics.RIGHT);
		}
		else
			BitmapFont.drawBoldFont(g, "Sân " + m_iId, x + width - 10, y + height/2 - 7, 0x3a001e, Graphics.VCENTER | Graphics.RIGHT);
		BitmapFont.drawOutlinedString(g, "" + money, x + width - 10, y + height/2 + 7, 0xfaf703, 0x660606, Graphics.VCENTER | Graphics.RIGHT);
		if(isPass){
			GameResource.instance.m_frameIconItems.drawFrame(1, x + width - 80, y + 5, 0, g);
		}
		//
		g.setColor(0x3c8dc0);
		int i;
		for(i=0;i<maxPlayer;i++){			
			if(nPlayer> i){
				GameResource.instance.m_frameEmotion.drawFrame(18, x + 2 + 22 * i, y + 5, 0, g);
			}
			else
				g.fillRoundRect(x + 2 + 22 * i, y + 5, 20, 20, 20, 20);
		}
	}
}
